<!--#index.html-->
<!--body-->
<script>
    var htimeout;
    $(function() {
        $("#form").ajaxForm({
            success : function(data) {
                if(data.msg) {
                    $(".alert span").text(data.msg);
                    $(".alert").removeClass("alert-success").addClass("alert-error");
                    $(".alert").fadeOut("fast").fadeIn("fast")
                } else {
                    $(".alert span").html("登录成功，3秒钟后自动<a href='/' onclick='clearTimeout(htimeout)'>跳转</a>");
                    $(".alert").removeClass("alert-error").addClass("alert-success");
                    $(".alert").fadeOut(0).fadeIn("fast");
                    htimeout = setTimeout("window.location.href = '/'", 3000);
                }
            }
        })
        $(".alert button").click(function() {
            $(".alert").hide("fast")
        })
    })
</script>
<form action="user.login" method="post" id="form" class="form-horizontal">
    <legend>登录wBlog</legend>
    <div class="alert alert-error">
        <button type="button" class="close">×</button>
        <span></span>
    </div>
    <div class="control-group">
        <label class="control-label" for="id">用户名</label>
        <div class="controls">
            <input type="text" id="id" placeholder="" name="user.id"/>
        </div>
    </div>
    <div class="control-group">
        <label class="control-label" for="pwd">密码</label>
        <div class="controls">
            <input type="password" id="pwd" placeholder="" name="user.pwd"/>
        </div>
    </div>
    <div class="control-group">
        <div class="controls">
            <input type="submit" value="登录" class="btn btn-primary"/>
        </div>
    </div>
</form>
<!--body end-->
<!--#index.html end-->